package com.luoc;

import com.luoc.service.DecoratorComponent;
import com.luoc.service.impl.DecoratorConcreteComponent;
import com.luoc.service.impl.DecoratorImpl;

/**
 * @Author: luoc
 * @Date: 2019/9/20 10:27
 *  装饰模式(Decorator Pattern)：动态地给一个对象增加一些额外的职责，
 *  就增加对象功能来说，装饰模式比生成子类实现更为灵活。装饰模式是一种对象结构型模式。
 *
 *  聚合替代继承
 */
public class DecoratorPattern {
    public static void main(String[] args) {
        DecoratorComponent decorator =  new DecoratorConcreteComponent();


        DecoratorImpl decorator1 = new DecoratorImpl(decorator);
        decorator1.opration();


    }
}
